*----------------------------------------------------------------
*Title:  Chapter2.do
*Date:  September 26, 2000
*Project:  Dissertation
*Data:  diss012699.dta
*Description:  This batch file is written to include analysis 
*described in Chapter 4 of my dissertation.
*
*----------------------------------------------------------------
use diss012699

*This is the batch file to estimate the models in chapter 2 and chapter 5.  In these specifications I exclude vetoes.
generate appdivma=approv*divided*majorh
generate count10=com+ind+term+mem
generate appmajh=approv*majorh

*Now I will generate the 3 way interaction.

generate mndivmaj=monthin*divided*majorh

**Now I move on to the analysis in Chapter2 on only the legislatively-created agencies.**

drop if leg==0
*drop if agencyid==10274
*drop if agencyid==10271
*drop if agencyid==10567
*drop if agencyid==10219
*drop if agencyid==10349
*drop if agencyid==10549
*drop if agencyid==10483
*drop if agencyid==10173

**Now I will do the analysis for the main text.
oprobit locat1 divided approv app_div majorh mjh_div line trend, cluster(year)
probit com divided approv app_div majorh mjh_div line trend, cluster(year)
probit ind divided approv app_div majorh mjh_div line trend, cluster(year)

more
probit term divided approv app_div majorh mjh_div line trend, cluster(year)
probit mem divided approv app_div majorh mjh_div line trend, cluster(year)
predict plm
summarize approv majorh trend if plm~=.
more

*Now with length
oprobit locat1 divided approv app_div length div_len line trend, cluster(year)
probit com divided approv app_div length div_len line trend, cluster(year)
probit ind divided approv app_div length div_len line trend, cluster(year)

more
probit term divided approv app_div length div_len line trend, cluster(year)
probit mem divided approv app_div length div_len line trend, cluster(year)


*Now with 3 way interaction
oprobit locat1 divided approv app_div appmajh majorh mjh_div appdivma line trend, cluster(year)
probit com divided approv app_div appmajh majorh mjh_div appdivma line trend, cluster(year)
probit ind divided approv app_div appmajh majorh mjh_div appdivma line trend, cluster(year)
more
probit term divided approv app_div appmajh majorh mjh_div appdivma line trend, cluster(year)
probit mem divided approv app_div appmajh majorh mjh_div appdivma line trend, cluster(year)
more

*Now I will do the analysis with agency budget
generate bud92=ln(budget/gdpdefla)

oprobit locat1 divided approv app_div majorh mjh_div bud92 trend exec sec reorg external, cluster(year)
probit com divided approv app_div majorh mjh_div bud92 trend exec sec reorg external, cluster(year)
probit ind divided approv app_div majorh mjh_div bud92 trend exec sec reorg external, cluster(year)

more
probit term divided approv app_div majorh mjh_div bud92 trend pmade external, cluster(year)
probit mem divided approv app_div majorh mjh_div bud92 trend exec sec reorg external, cluster(year)
oprobit count10 divided approv app_div majorh mjh_div bud92 trend exec sec reorg external, cluster(year)
more
